package com.jiankang.askhealth.base.web;

import com.jiankang.askhealth.aware.PagerAware;


public class PagingAction extends BaseAction implements PagerAware{
	private int pageSize = 20;
	private int pageIndex = 1;
	private int total;
	private int pageNum;

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getPageIndex() {
		return pageIndex;
	}

	public void setPageIndex(int pageIndex) {
		this.pageIndex = pageIndex;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public int getPageNum() {
		return pageNum;
	}

	public void setPageNum() {
		int mod = total % pageSize;
	    if (mod > 0) {
	    	pageNum = (total - mod) / pageSize + 1;
	    }
	    else {
	    	pageNum = total / pageSize;
	    }
    }
	
}
